package animalmanage;

public class Mammal extends Animal{

    public Mammal(){

    }
    //如果不指定数量。默认这个区域内这种动物的数目为一
    public Mammal(String MammalName){
        int AnimalNum=getAnimalNum();
        if(getAnimalNum()==0){
            AnimalNum++;
        }
        else{
            AnimalNum=getAnimalNum()+1;
        }
        super.setAnimalName(MammalName);
        super.setAnimalNum(AnimalNum);
        SetMammalArea();

    }
    public Mammal(String MammalName,String MammalArea){
        int AnimalNum=getAnimalNum();
        if(getAnimalNum()==0){
            AnimalNum++;
        }
        else{
            AnimalNum=getAnimalNum()+1;
        }
        super.setAnimalName(MammalName);
        super.setAnimalNum(AnimalNum);
        SetMammalArea(MammalArea);

    }

    public Mammal(String MammalName,int MammalNum,String MammalArea){
        super.setAnimalName(MammalName);
        super.setAnimalNum(MammalNum+getAnimalNum());
        SetMammalArea(MammalArea);
    }
    public Mammal(String MammalName,int MammalNum){
        super.setAnimalName(MammalName);
        super.setAnimalNum(MammalNum+getAnimalNum());
        SetMammalArea();
    }
    //对于哺乳动物的区域和数量重新设定
    public void SetMammalArea() {
        super.setAnimalArea("脯乳动物园区");
    }
    public void SetMammalArea(String MammalArea) {
        super.setAnimalArea(MammalArea);
    }
    public void SetMammalNum(int MammalNum){
        super.setAnimalNum(MammalNum);
    }
}